﻿<navigation:Page x:Class="Mal.Balades.Admin.Views.VisitViews.Edit.Main" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:controls="clr-namespace:Mal.Balades.Admin.Controls"
           xmlns:windowsControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:viewmodels="clr-namespace:Mal.Balades.Admin.ViewModels.VisitViewModels.Edit" 
           d:DesignWidth="640" d:DesignHeight="480"
           Title="VisitEdit Page">
    <navigation:Page.DataContext>
        <viewmodels:VisitEditViewModel />
    </navigation:Page.DataContext>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
            <windowsControls:TabControl Grid.Row="0"
                    SelectedIndex="{Binding SelectedTabIndex, Mode=TwoWay}"
                    ItemsSource="{Binding Tabs, Converter={StaticResource TabItemConverter}}" />


        <Border Grid.Row="1">
            <StackPanel Orientation="Horizontal">
                <StackPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Margin" Value="10,5,0,5" />
                    </Style>
                </StackPanel.Resources>
                <Button Command="{Binding AddCommand}" Content="Ajouter" IsEnabled="{Binding SelectedTab.AddCommandEnabled}" />
                <Button Command="{Binding SaveCommand}" Content="Enregistrer" />
            </StackPanel>
        </Border>
    </Grid>
</navigation:Page>
